SET( TOOLKIT_PLUGIN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TOOLKIT_PLUGIN_OUTPUT_DIR})
IF(BUILD_OSX_BUNDLE)
SET( PLUGIN_INSTALL_DIR ${CMAKE_BINARY_DIR}/rbdl-toolkit.app/Contents/Resources/plugins)
ELSE(BUILD_OSX_BUNDLE)
SET( PLUGIN_INSTALL_DIR share/ORB/rbdl-toolkit/plugins )
ENDIF(BUILD_OSX_BUNDLE)

OPTION ( TOOLKIT_BUILD_CORE_PLUGINS "Build core plugins" ON )
OPTION ( TOOLKIT_BUILD_OPTIONAL_PLUGINS "Build optional plugins" OFF )

IF (TOOLKIT_BUILD_CORE_PLUGINS)
	ADD_SUBDIRECTORY(AnimationPlugin)
	ADD_SUBDIRECTORY(CameraOperatorPlugin)
	ADD_SUBDIRECTORY(ForceTorquePlugin)
ENDIF (TOOLKIT_BUILD_CORE_PLUGINS)

IF (TOOLKIT_BUILD_OPTIONAL_PLUGINS)
	ADD_SUBDIRECTORY(RenderPlugin)
	ADD_SUBDIRECTORY(MotionMarkerPlugin)
	ADD_SUBDIRECTORY(InverseKinematicsPlugin)
ENDIF (TOOLKIT_BUILD_OPTIONAL_PLUGINS)

